package com.yit.test.demo;

import com.yit.test.demo.Entity.OrderInfo;
import com.yit.test.demo.Entity.PriceInfo;
import com.yit.test.demo.Entity.ProductInfo;

/**
 * Created by zhangyanfei on 2017/8/31.
 *
 * @author zhangyanfei
 * @date 2017/08/31
 */
public class OrderService {
    private PriceService priceService=new PriceService();

    private ProductService productService=new ProductService();

    /**
     * 该方法是返回订单信息
     * 依赖价格服务、商品服务
     * @param orderCode
     * @return
     */
    public OrderInfo getOrderInfoByOrderCode(String orderCode){
        PriceInfo priceInfo=priceService.getPriceInfoByProductCode("L3001");
        ProductInfo productInfo=productService.getProductInfoByProductCode("L3001");
        OrderInfo orderInfo=new OrderInfo();
        orderInfo.optionText=productInfo.optionText;
        orderInfo.productCode=productInfo.productCode;
        orderInfo.productName=productInfo.productName;
        orderInfo.price=priceInfo.price;
        return orderInfo;
    }
}
